package org.ielse.frame.t.view.ultra.util;

import java.util.ArrayList;
import java.util.List;

import android.graphics.Point;

public class RefreshPoint {
	public static ArrayList<float[]> getLoadingText() {
		List<Point> startPoints = new ArrayList<Point>();
		startPoints.add(new Point(5, 12));
		startPoints.add(new Point(22, 12));
		startPoints.add(new Point(22, 26));
		startPoints.add(new Point(19, 4));
		startPoints.add(new Point(29, 12));
		startPoints.add(new Point(31, 13));
		startPoints.add(new Point(42, 13));
		startPoints.add(new Point(30, 25));

		startPoints.add(new Point(52, 7));
		startPoints.add(new Point(57, 0));
		startPoints.add(new Point(50, 12));
		startPoints.add(new Point(54, 16));
		startPoints.add(new Point(60, 13));
		startPoints.add(new Point(54, 24));
		startPoints.add(new Point(55, 30));
		startPoints.add(new Point(61, 20));
		startPoints.add(new Point(68, 7));
		startPoints.add(new Point(77, 29));
		startPoints.add(new Point(70, 30));
		startPoints.add(new Point(74, 5));

		startPoints.add(new Point(95, 12));
		startPoints.add(new Point(98, 12));
		startPoints.add(new Point(118, 12));
		startPoints.add(new Point(95, 25));
		startPoints.add(new Point(106, 2));

		List<Point> endPoints = new ArrayList<Point>();
		endPoints.add(new Point(22, 13));
		endPoints.add(new Point(22, 26));
		endPoints.add(new Point(18, 26));
		endPoints.add(new Point(7, 32));
		endPoints.add(new Point(30, 25));
		endPoints.add(new Point(42, 13));
		endPoints.add(new Point(41, 25));
		endPoints.add(new Point(41, 25));

		endPoints.add(new Point(62, 8));
		endPoints.add(new Point(57, 12));
		endPoints.add(new Point(82, 12));
		endPoints.add(new Point(66, 17));
		endPoints.add(new Point(54, 24));
		endPoints.add(new Point(64, 24));
		endPoints.add(new Point(65, 29));
		endPoints.add(new Point(61, 34));
		endPoints.add(new Point(77, 29));
		endPoints.add(new Point(81, 27));
		endPoints.add(new Point(78, 20));
		endPoints.add(new Point(76, 9));

		endPoints.add(new Point(95, 25));
		endPoints.add(new Point(118, 12));
		endPoints.add(new Point(118, 25));
		endPoints.add(new Point(118, 25));
		endPoints.add(new Point(106, 35));

		ArrayList<float[]> list = new ArrayList<float[]>();

		int offsetX = Integer.MAX_VALUE;
		int offsetY = Integer.MAX_VALUE;

		for (int i = 0; i < startPoints.size(); i++) {
			offsetX = Math.min(startPoints.get(i).x, offsetX);
			offsetY = Math.min(startPoints.get(i).y, offsetY);
		}
		for (int i = 0; i < endPoints.size(); i++) {
			float[] point = new float[4];
			point[0] = startPoints.get(i).x - offsetX;
			point[1] = startPoints.get(i).y - offsetY;
			point[2] = endPoints.get(i).x - offsetX;
			point[3] = endPoints.get(i).y - offsetY;
			list.add(point);
		}
		return list;
	}
}
